package com.lcy.redismessage.listener;

import cn.hutool.json.JSONUtil;
import com.lcy.redismessage.domain.vo.RedisQueueMsg;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBoundedBlockingQueue;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 监听器
 */
@Component
@Slf4j
public class TestListener implements RedisDelayedQueueListener<RedisQueueMsg> {
    @Autowired
    RedissonClient redissonClient;
    @Override
    public void invoke(RedisQueueMsg redisQueueMsg) {
        try {
            log.info("执行.... {}", JSONUtil.toJsonStr(redisQueueMsg));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
